# @Author：silence
# @Email：792245022@qq.com
# @Date：2025/3/1 12:04

"""
说明：将一张图片/一首歌 拷贝到另一个目录下
"""

f_src_path = "E://Workspaces//IO_Test//test.xlsx"
f_dst_path = "E://Workspaces//IO_Test//test_copy.xlsx"

# fr = open(f_src_path, "rb")
#
# data = fr.read()
#
# fw = open(f_dst_path, "wb")
#
# fw.write(data)
#
# fr.close()
# fw.close()

# 使用 with 子句的方式完成文件的拷贝
with open(f_src_path, "rb") as fr, open(f_dst_path, "wb") as fw:
    for data in fr:
        fw.write(data)